//
//  NEADEntity.m
//  NetEasyNews
//
//  Created by weiwang on 16/7/17.
//  Copyright © 2016年 王伟. All rights reserved.
//


#import "NEADEntity.h"

@implementation NEADEntity

-(void)archive
{
    NSData *archiveCarPriceData = [NSKeyedArchiver archivedDataWithRootObject:self];
    [[NSUserDefaults standardUserDefaults] setObject:archiveCarPriceData forKey:@"ADArchiveData"];
}

+ (NSDictionary *)mj_objectClassInArray
{
    return @{
             @"ads" : @"NEADDataEntity",
             };
}

#pragma mark- NSCodingDelegate
- (void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:@(self.result) forKey:@"result"];
    [aCoder encodeObject:self.ads forKey:@"ads"];
    [aCoder encodeObject:self.expired_time forKey:@"expired_time"];
    [aCoder encodeObject:self.flight_id forKey:@"flight_id"];
    [aCoder encodeObject:self.content forKey:@"content"];
    [aCoder encodeObject:self.style forKey:@"style"];
    [aCoder encodeObject:self.is_sens forKey:@"is_sens"];
    [aCoder encodeObject:self.show_time forKey:@"show_time"];
    [aCoder encodeObject:self.vdog forKey:@"vdog"];
    [aCoder encodeObject:self.vdot forKey:@"vdot"];
    [aCoder encodeObject:self.monitorClickUrl forKey:@"monitorClickUrl"];
}

- (id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super init];
    if (self)
    {
        self.result = [[aDecoder decodeObjectForKey:@"result"] integerValue];
        self.ads = [aDecoder decodeObjectForKey:@"ads"];
        self.expired_time = [aDecoder decodeObjectForKey:@"expired_time"];
        self.flight_id = [aDecoder decodeObjectForKey:@"flight_id"];
        self.content = [aDecoder decodeObjectForKey:@"content"];
        self.style = [aDecoder decodeObjectForKey:@"style"];
        self.is_sens = [aDecoder decodeObjectForKey:@"is_sens"];
        self.show_time = [aDecoder decodeObjectForKey:@"show_time"];
        self.vdog = [aDecoder decodeObjectForKey:@"vdog"];
        self.vdot = [aDecoder decodeObjectForKey:@"vdot"];
        self.monitorClickUrl = [aDecoder decodeObjectForKey:@"monitorClickUrl"];
    }
    return self;
}
@end
